HTML5 Foundations by Matt West

HTML5 Foundations by Matt West

Author:Matt West
Language: eng
Format: mobi, epub, pdf
Published: 2012-11-09T05:00:00+00:00


<section id="location3" itemscope

itemtype="http://schema.org/LocalBusiness"

itemref="company-name">

<h1 itemprop="address" itemscope

itemtype="http://schema.org/PostalAddress">

<span itemprop="streetAddress">200 West 44th Street</span>,

<span itemprop="addressRegion">NY</span>

</h1>

<img src="img/map3.png"

alt="Joe’s Pizza at 200 West 44th Street, NY"

itemprop="image">

<p class="location-phone" itemprop="telephone">212 012 3458</p>

<h2>Opening Hours:</h2>

<p>

<time itemprop="openingHours" datetime="Mo-Fr 12:00-22:00">

Mon-Fri: 12:00 - 22:00</time><br>

<time itemprop="openingHours" datetime="Sa,Su 11:00-23:00">

Sat-Sun: 11:00 - 23:00</time>

</p>

</section>

</section>

Now that you are finished with the Locations page, take a look at the rest of the pages on the website. Are there any other areas of content that you think would benefit from the use of microdata? Try adding microdata to those areas (you might need to read the rest of this chapter first).

Events

Marking up your events data enables computer programs to use this data for a number of possible applications. For example, imagine if when you did a web search for an event, the important details about the event appeared right there in the search results, saving you the job of having to find the correct link in the results and then scan the web page for details about the event. That could be really useful.

Google already does something similar to this. If you search for your favorite sports team Google will show you a summary of recent results and upcoming games above the normal search results.

Every October Joe’s Pizza Co. runs a number of special events in celebration of national Italian-American heritage month. In this section you learn how to use microdata to mark up one of these events.

You can define an event by using the Event schema.

<div itemscope itemtype="http://schema.org/Event"></div>

Events have the same four basic properties that all schema.org items have: name, description, image, and url, plus the properties outlined in the following list.

• startDate—Your startDate should be supplied in a machine-readable format. It’s usually best to use a <time> element when specifying dates and times with microdata. Computer programs will use the contents of the datetime attribute. The Joe’s Pizza Co. event will start at 9am on Saturday 5th October.

<time itemprop="startDate" datetime="2013-10-05T09:00">

Saturday 5th October at 9am

</time>



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.